package com.example.demo.Controller;

import jakarta.annotation.Resource;
import org.springframework.stereotype.Controller;

@Controller // 将对象存储到 Spring 中
public class UserController {
    //注⼊user
    @Resource(name = "user2")
    private User user;

    public void sayHi(){
        System.out.println("hi,UserController...");
        System.out.println(user);
    }
}